load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
load("@kubevirt//tools/ginkgo:ginkgo.bzl", "ginkgo_test")

go_library(
    name = "go_default_library",
    srcs = [
        "migration.go",
        "non-root.go",
        "options.go",
        "realtime.go",
        "retry_manager.go",
        "setsched.go",
        "vm.go",
    ],
    importpath = "kubevirt.io/kubevirt/pkg/virt-handler",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/config:go_default_library",
        "//pkg/container-disk:go_default_library",
        "//pkg/controller:go_default_library",
        "//pkg/ephemeral-disk-utils:go_default_library",
        "//pkg/executor:go_default_library",
        "//pkg/handler-launcher-com/cmd/v1:go_default_library",
        "//pkg/host-disk:go_default_library",
        "//pkg/hotplug-disk:go_default_library",
        "//pkg/network/cache:go_default_library",
        "//pkg/network/errors:go_default_library",
        "//pkg/network/namescheme:go_default_library",
        "//pkg/network/setup:go_default_library",
        "//pkg/network/vmispec:go_default_library",
        "//pkg/pointer:go_default_library",
        "//pkg/safepath:go_default_library",
        "//pkg/storage/reservation:go_default_library",
        "//pkg/storage/types:go_default_library",
        "//pkg/util:go_default_library",
        "//pkg/util/hardware:go_default_library",
        "//pkg/util/migrations:go_default_library",
        "//pkg/virt-config:go_default_library",
        "//pkg/virt-controller/services:go_default_library",
        "//pkg/virt-controller/watch/topology:go_default_library",
        "//pkg/virt-handler/cache:go_default_library",
        "//pkg/virt-handler/cgroup:go_default_library",
        "//pkg/virt-handler/cmd-client:go_default_library",
        "//pkg/virt-handler/container-disk:go_default_library",
        "//pkg/virt-handler/device-manager:go_default_library",
        "//pkg/virt-handler/heartbeat:go_default_library",
        "//pkg/virt-handler/hotplug-disk:go_default_library",
        "//pkg/virt-handler/isolation:go_default_library",
        "//pkg/virt-handler/migration-proxy:go_default_library",
        "//pkg/virt-handler/node-labeller/api:go_default_library",
        "//pkg/virt-handler/selinux:go_default_library",
        "//pkg/virt-launcher/virtwrap/api:go_default_library",
        "//pkg/virtiofs:go_default_library",
        "//pkg/watchdog:go_default_library",
        "//staging/src/kubevirt.io/api/core/v1:go_default_library",
        "//staging/src/kubevirt.io/client-go/kubecli:go_default_library",
        "//staging/src/kubevirt.io/client-go/log:go_default_library",
        "//vendor/github.com/mitchellh/go-ps:go_default_library",
        "//vendor/github.com/opencontainers/runc/libcontainer/cgroups:go_default_library",
        "//vendor/golang.org/x/sys/unix:go_default_library",
        "//vendor/k8s.io/api/core/v1:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/api/equality:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/api/resource:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/types:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/util/errors:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library",
        "//vendor/k8s.io/client-go/tools/cache:go_default_library",
        "//vendor/k8s.io/client-go/tools/record:go_default_library",
        "//vendor/k8s.io/client-go/util/workqueue:go_default_library",
    ],
)

go_test(
    name = "go_default_test",
    timeout = "long",
    srcs = [
        "migration_test.go",
        "non-root_test.go",
        "realtime_test.go",
        "retry_manager_test.go",
        "virt_handler_suite_test.go",
        "vm_test.go",
    ],
    embed = [":go_default_library"],
    tags = ["cov"],
    deps = [
        "//pkg/certificates:go_default_library",
        "//pkg/controller:go_default_library",
        "//pkg/ephemeral-disk-utils:go_default_library",
        "//pkg/handler-launcher-com/cmd/v1:go_default_library",
        "//pkg/network/cache:go_default_library",
        "//pkg/network/errors:go_default_library",
        "//pkg/safepath:go_default_library",
        "//pkg/testutils:go_default_library",
        "//pkg/unsafepath:go_default_library",
        "//pkg/util:go_default_library",
        "//pkg/virt-config:go_default_library",
        "//pkg/virt-controller/services:go_default_library",
        "//pkg/virt-handler/cache:go_default_library",
        "//pkg/virt-handler/cgroup:go_default_library",
        "//pkg/virt-handler/cmd-client:go_default_library",
        "//pkg/virt-handler/container-disk:go_default_library",
        "//pkg/virt-handler/hotplug-disk:go_default_library",
        "//pkg/virt-handler/isolation:go_default_library",
        "//pkg/virt-handler/migration-proxy:go_default_library",
        "//pkg/virt-handler/notify-server:go_default_library",
        "//pkg/virt-launcher/notify-client:go_default_library",
        "//pkg/virt-launcher/virtwrap/api:go_default_library",
        "//pkg/watchdog:go_default_library",
        "//staging/src/kubevirt.io/api/core/v1:go_default_library",
        "//staging/src/kubevirt.io/client-go/api:go_default_library",
        "//staging/src/kubevirt.io/client-go/kubecli:go_default_library",
        "//staging/src/kubevirt.io/client-go/precond:go_default_library",
        "//staging/src/kubevirt.io/client-go/testutils:go_default_library",
        "//vendor/github.com/golang/mock/gomock:go_default_library",
        "//vendor/github.com/onsi/ginkgo/v2:go_default_library",
        "//vendor/github.com/onsi/gomega:go_default_library",
        "//vendor/k8s.io/api/core/v1:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/api/resource:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/types:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/util/uuid:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/watch:go_default_library",
        "//vendor/k8s.io/client-go/kubernetes/fake:go_default_library",
        "//vendor/k8s.io/client-go/testing:go_default_library",
        "//vendor/k8s.io/client-go/tools/cache:go_default_library",
        "//vendor/k8s.io/client-go/tools/cache/testing:go_default_library",
        "//vendor/k8s.io/client-go/tools/record:go_default_library",
        "//vendor/k8s.io/utils/pointer:go_default_library",
    ],
)

ginkgo_test(
    name = "go_parallel_test",
    ginkgo_args = ["-p"],
    go_test = ":go_default_test",
    tags = ["nocov"],
)
